package com.quan.bookmall.dto;

import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
public class BookDTO {
    
    private Long id;
    
    @NotBlank(message = "书名不能为空")
    private String name;
    
    @NotBlank(message = "作者不能为空")
    private String author;
    
    private String cover;
    
    @NotBlank(message = "ISBN编号不能为空")
    private String isbn;
    
    @NotNull(message = "价格不能为空")
    @Positive(message = "价格必须为正数")
    private BigDecimal price;
    
    @NotNull(message = "库存不能为空")
    @Min(value = 0, message = "库存不能为负数")
    private Integer stock;
    
    private String description;
    
    private String publisher;
    
    private LocalDateTime createTime;
    
    private LocalDateTime updateTime;
} 